package cn.wit.luohui.day08;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
import java.util.TreeSet;

import org.junit.Test;

import cn.wit.luohui.day08.Employee;

public class TestSet{

	@Test
	public void testTreeSet2() {
		Set<Employee>set=new TreeSet<>();
		//set.add(new Employee("java",18));
		set.add(new Employee("java", 18));
		set.add(new Employee("java", 18));
		set.add(new Employee("c++", 28));
		set.add(new Employee("javascript", 17));
		set.add(new Employee("swift", 6));
		set.add(new Employee("luohui", 20));
		
		Employee e1=new Employee("swift",18);
		Employee e2 = new Employee("luohui", 20);
		System.out.println(e1.equals(e2));//�ж�e1��e2�����Ƿ����
		System.out.println(e1.compareTo(e2));
		
		for(Employee e:set) {
			System.out.println(e);
		}
	}
	
}
